<?php

namespace App\Models;

/**
 * App\Models\SysAnnounce
 * This is the model class for table "sys_announce".
 *
 * @property int $id 自增ID
 * @property int $user_id 消息发送用户ID
 * @property int $template_id 对应[sys_message_template]表ID
 * @property string $title 标题
 * @property string $content 公告内容json串
 * @property int $platform 二进制数，公告发送目的地，数字相加：PC端1，安卓2，iOS4
 * @property string $template_content_params 模板消息内容填充值，以逗号分隔
 * @property int $is_send 是否发送，0未发送，1已发送
 * @property int $is_use_template 是否使用模板，0未使用，1使用
 * @property int $is_revoke 撤回状态，0未撤回，1撤回
 * @property int $is_deleted 删除状态，0正常，1删除
 * @property int $send_admin_id 发送公告的管理员ID
 * @property int $send_at 发送时间戳
 * @property int $created_at 创建时间戳
 * @property int $updated_at 更新时间戳
 * @method static \Illuminate\Database\Eloquent\Builder|SysAnnounce newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|SysAnnounce newQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|SysAnnounce query()
 */
class SysAnnounce extends BaseModel
{

    protected $table = "sys_announce";
    protected $primaryKey = "id";
    protected $keyType = "int";
    public $timestamps = true;

    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [];

    /**
     * The attributes that should be hidden for arrays.
     *
     * @var array
     */
    protected $hidden = [];

    /**
     * The attributes that should be cast to native types.
     *
     * @var array
     */
    protected $casts = [
        'created_at' => 'timestamp',
        'updated_at' => 'timestamp',
    ];

    /**
     * select columns
     * @var array
     */
    public $fields = [
        'message' => ['id', 'template_id', 'title', 'content', 'is_use_template', 'template_content_params',  'created_at'],
    ];

}
